package com.wcf.thread.demo;

import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Created by hadoop on 2016/1/31.
 */
public class TestScheduledThreadPoolExecutor {
    private static final ScheduledThreadPoolExecutor exec = new ScheduledThreadPoolExecutor(1);

    public static void main(String[] args) {
        exec.scheduleAtFixedRate(new Runnable() {
            @Override
            public void run() {
                System.out.println(System.nanoTime());
            }
        },1000,2000, TimeUnit.MILLISECONDS);
    }
}
